#include "SMPPSourceSubaddress.hpp"

using namespace smpp::pdu;

SourceSubaddress::SourceSubaddress(const octetString &nValue):
TLV(TLVtags::TAG_SOURCE_SUBADDRESS,nValue.size()),_Value(nValue){}

SourceSubaddress::SourceSubaddress(
const SourceSubaddress &nSourceSubaddress):
TLV(nSourceSubaddress),_Value(nSourceSubaddress.getValue()){}

bool SourceSubaddress::operator ==(
	const SourceSubaddress &nSourceSubaddress) const{
	return (TLV::operator == (nSourceSubaddress) && 
			_Value == nSourceSubaddress.getValue());
}

bool SourceSubaddress::operator !=(
	const SourceSubaddress &nSourceSubaddress) const{
	return !this->operator == (nSourceSubaddress);
}

SourceSubaddress &SourceSubaddress::operator = (
	const SourceSubaddress &nSourceSubaddress){
	if(*this == nSourceSubaddress)
		return *this;
	TLV::operator = (nSourceSubaddress);
	_Value = nSourceSubaddress.getValue();
	return *this;
}

void SourceSubaddress::setValue(const octetString &nValue){
	_Value = nValue;
}

const octetString &SourceSubaddress::getValue() const{
	return _Value;
}
